import { reqOrderInfo,reqAddressInfo } from '@/api'

const state = {
    orderInfo:{},
    addressInfo:[]
};
const mutations = {
    ORDERINFO(state,orderInfo){
        state.orderInfo = orderInfo
    },
    ADDRESSINFO(state,addressInfo){
        state.addressInfo = addressInfo
    }

};
const actions = {
    async orderInfo({commit}){
        let result = await reqOrderInfo()
        if (result.code==200) {
            commit('ORDERINFO',result.data)
        }
    },
    async addressInfo({commit}){
        let result = await reqAddressInfo()
        if (result.code==200) {
           commit('ADDRESSINFO',result.data)
        }
        
    }
};
const getters = {
     
};

export default {
    // namespaced: true,
    // name: 'user',
    state,
    mutations,
    actions,
    getters
}